package learningThread.api.daemon;

public class Run {

    public static void main(String[] args) {
        try {
            MyThread myThread = new MyThread();
            myThread.setDaemon(true);  //设置相乘 thread 是守护线程
            myThread.start();
            Thread.sleep(5000);
            System.out.println("我离开thread对象也不打印,也就是停止了!");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
